package com.kob.backend.controller.user;

import com.kob.backend.pojo.User;
import com.kob.backend.service.user.UserService;
import com.kob.backend.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 用户信息更新controller
 *
 * @Author: CZY
 * @date: 2024/9/1 22:23
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/api/user/account/updateInfo/")
    public Result<User> update(@RequestParam Map<String, String> data) {
        return userService.update(data);
    }

    @PostMapping("/api/user/account/updatePassword/")
    public Result updatePassword(@RequestParam Map<String, String> data) {
        return userService.updatePassword(data);
    }

    @PostMapping("/api/user/account/updateScore/")
    public Result updateScore(@RequestParam Map<String, String> data) {
        return userService.updateScore(data);
    }
}
